<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link type="text/css" rel="stylesheet" href="__PUBLIC__/dpa/css/weui.css"/>
    <link type="text/css" rel="stylesheet" href="__PUBLIC__/dpa/css/search.css"/>
    <link type="text/css" rel="stylesheet" href="__PUBLIC__/weui-1.0.2/dist/style/weui.min.css"/>
    <script type="text/javascript" src="__PUBLIC__/dpa/js/jquery-2.1.4.js"></script>
    <script type="text/javascript" src="__PUBLIC__/dpa/js/jquery-weui.js"></script>
    <title>交接二维码确认</title>
    <style>
        #loadingToast {
            position: absolute;
            top: 10%;
        }
    </style>
</head>
<script>
    document.addEventListener('WeixinJSBridgeReady',
            function onBridgeReady(){
                WeixinJSBridge.call('hideOptionMenu');
            }
    );
    function abc(){
        WeixinJSBridge.call('closeWindow');
    }
</script>
<body>
<div class="weui_cells out-width">
    <div class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary left-text">
            <p>DPA报告号</p>
        </div>
        <div class="weui_cell_ft right-text"><?php echo $dpasum; ?></div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary left-text">
            <p>委托单位</p>
        </div>
        <div class="weui_cell_ft right-text"><?php echo $requester; ?></div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary left-text">
            <p>发放人</p>
        </div>
        <div class="weui_cell_ft right-text"><?php echo $givename; ?></div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary left-text">
            <p>发放日期</p>
        </div>
        <div class="weui_cell_ft right-text"><?php echo date('Y-m-d',$givetime); ?></div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary left-text">
            <p>发放地点</p>
        </div>
        <div class="weui_cell_ft right-text"><?php echo $givelocation; ?></div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary left-text">
            <p>接收人</p>
        </div>
        <div class="weui_cell_ft right-text"><?php echo $getname; ?></div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary left-text">
            <p>接收日期</p>
        </div>
        <div class="weui_cell_ft right-text"><?php echo date('Y-m-d',$gettime); ?></div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary left-text">
            <p>接收地点</p>
        </div>
        <div class="weui_cell_ft right-text"><?php echo $getlocation; ?></div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_bd weui_cell_primary left-text">
            <p>电话</p>
        </div>
        <div class="weui_cell_ft right-text"><?php echo $tel; ?></div>
    </div>
</div>

<!--加载进度开始-->
<div id="loadingToast" style="display:none;">
    <div class="weui-mask_transparent"></div>
    <div class="weui-toast">
        <i class="weui-loading weui-icon_toast"></i>
        <p class="weui-toast__content">拼命加载中</p>
    </div>
</div>
<!--加载进度结束-->

<div style="margin-bottom:10px;"></div>
<div style="text-align:center" class="button-sp-area">
    <input type="button" style="width:40%;height:40px;margin-right:30px;font-size:18px" id="cx" href="javascript:;" class="weui-btn weui-btn_mini weui-btn_primary" value="确认">
    <input type="button" style="width:40%;height:40px;font-size:18px" id="qc" href="javascript:;" class="weui-btn weui-btn_mini weui-btn_warn" value="取消">
</div>
<div><br></div>
<!--尾部开始-->
<div class="weui-msg__extra-area">
    <div class="weui-footer">
        <p class="weui-footer__links">
            <a href="javascript:void(0);" class="weui-footer__link">中国航天-神舟软件</a>
        </p>
        <p class="weui-footer__text">Copyright &copy; 2008-2016 </p>
    </div>
</div>
<!--尾部结束-->

</body>
<script>
    //退回到上一页面
    $('#qc').click(function(){
        history.go(-1);
    })
    //点击确认数据插入数据库
    $('#cx').click(function(){
        var givetime = '{$givetime}';
        var gettime = '{$gettime}';
        var givelocation = '{$givelocation}';
        var getlocation = '{$getlocation}';
        var givename = '{$givename}';
        var getname = '{$getname}';
        var tel = '{$tel}';
        var dpasum = '{$dpasum}';
        var openid = '{$openid}';
        var requester = '{$requester}';
            $.ajax({
                type : 'post',
                url : '__CONTROLLER__/ajaxinsertconnect',
                data : {dpasum:dpasum,givename:givename,givetime:givetime,givelocation:givelocation,requester:requester,
                        getname:getname,gettime:gettime,getlocation:getlocation,tel:tel,openid:openid},
                success : function(vs){
                    if(vs == 1){
                        alert('DPA报告交接完成');
                        abc();
                    }else{
                        alert('DPA报告交接失败');
                    }
                }
            });
    });

</script>
</html>